#
from concurrent.futures import ThreadPoolExecutor, as_completed
from concurrent.futures import ProcessPoolExecutor
import time


def fib(n):
    if n <= 2: return 1
    return fib(n - 2) + fib(n - 1)


if __name__ == '__main__':

    with ProcessPoolExecutor(3) as executor:
        all_task = [executor.submit(fib, (num)) for num in range(25, 40)]
        start_time = time.time()
        for future in as_completed(all_task):
            data = future.result()
            print('the execute data:[{}]'.format(data))
        print('used time :{}'.format(time.time() - start_time))
